package com.ymh.spring.advance.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

import com.ymh.spring.advance.service.CellPhone;
import com.ymh.spring.advance.service.impl.Honor;
import com.ymh.spring.advance.service.impl.HuaWei;
import com.ymh.spring.advance.service.impl.Vivo;
import com.ymh.spring.advance.service.impl.XiaoMi;

@Configuration
public class PhoneConfig {
	
	
	@Bean(name="cellPhone")
	@Primary
	public CellPhone cellPhone1(){
		return new HuaWei();
	}
	
	@Bean(name="cellPhone")
	public CellPhone cellPhone2(){
		return new XiaoMi();
	}
	
	@Bean(name="cellPhone")
	public CellPhone cellPhone3(){
		return new Honor();
	}
	
	@Bean(name="cellPhone")
	public CellPhone cellPhone4(){
		return new Vivo();
	}

	
}
